Skip to content

Fix BankAPI withdraw and deposit widget IDs#175

Open
samlol wants to merge 3 commits intoTonic-Box:mainfrom
samlol:patch-1
Open

Fix BankAPI withdraw and deposit widget IDs#175
samlol wants to merge 3 commits intoTonic-Box:mainfrom
samlol:patch-1

Conversation

@samlol
Copy link
Copy Markdown

@samlol samlol commented Mar 12, 2026

Fix: BankAPI withdraw/deposit widget ID constants

  • Fixed withdrawAction() to use correct InterfaceID.Bankmain.ITEMS instead of TABS_LINE0
  • Fixed depositAll() to use correct InterfaceID.Bankmain.DEPOSITINV instead of PLACEHOLDER_GRAPHIC

Resolves issue where bank withdrawals and "Deposit Inventory" were failing due to incorrect widget IDs.

Fix: BankAPI withdraw/deposit widget ID constants

  - Fixed withdrawAction() to use correct InterfaceID.Bankmain.ITEMS instead of TABS_LINE0
  - Fixed depositAll() to use correct InterfaceID.Bankmain.DEPOSITINV instead of PLACEHOLDER_GRAPHIC

  Resolves issue where bank withdrawals and "Deposit Inventory" were failing due to incorrect widget IDs.
@samlol samlol changed the title Update BankAPI.java Fix BankAPI withdraw and deposit widget IDs Mar 12, 2026
@samlol
Copy link
Copy Markdown
Author

samlol commented Mar 16, 2026

Fix BankAPI.withdraw() using wrong action for Withdraw-1

Bug

Withdrawing 1 item would use the current Withdraw-X amount instead of 1. For example, if the Withdraw-X value was 7 from a previous withdrawal, calling BankAPI.withdraw(id, 1, false) would withdraw 7 items instead of 1.

Root Cause

withdrawAction() was using action 1 when withdrawing 1 item. When the bank is in Withdraw-X mode, action 1 corresponds to the Withdraw-X amount, not Withdraw-1.

Fix

Changed action 1 to action 2 for Withdraw-1. Action 2 correctly corresponds to the Withdraw-1 menu option in Withdraw-X mode.

Bank Menu Action Indices

Changes

  • BankAPI.java
    • withdrawAction(): Changed action 1 → 2 for Withdraw-1.
    • setX(): Removed debug print statement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant